Programming with exceptions in JCilk

نویسندگان

  • John S. Danaher
  • I-Ting Angelina Lee
  • Charles E. Leiserson
چکیده

JCilk extends the serial subset of the Java language by importing the fork-join primitives spawn and sync from the Cilk multithreaded language, thereby providing call-return semantics for multithreaded subcomputations. In addition, JCilk transparently integrates Java’s exception handling with multithreading by extending the semantics of Java’s try and catch constructs, but without adding new keywords. This extension is “faithful” in that it obeys Java’s ordinary serial semantics when executed on a single processor. When executed in parallel, however, an exception thrown by a JCilk computation causes its sibling computations to abort, which yields a clean semantics in which the enclosing cilk try block need only handle a single exception. The exception semantics of JCilk allow programs with speculative computations to be programmed easily. Speculation is essential in order to parallelize programs such as branchand-bound or heuristic search. We show how JCilk’s linguistic mechanisms can be used to program the “queens” puzzle and a parallel alpha-beta search. We have implemented JCilk’s semantic model in a prototype compiler and runtime system, called JCilk-1. The compiler implements continuations in a novel fashion by introducing goto statements into Java. The JCilk-1 runtime system shadows the dynamic hierarchy of cilk try blocks using a “try tree,” allowing the system to chase down side computations that must be aborted. Performance studies indicate that JCilk’s exception mechanism incurs minimal overhead, contributing at most a few percent on top of the cost

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The JCilk Language for Multithreaded Computing

JCilk extends the Java language to provide call-return semantics for multithreading, much as Cilk does for C. Java’s built-in thread model does not support the passing of exceptions or return values from one thread back to the “parent” thread that created it. JCilk imports Cilk’s fork-join primitives spawn and sync into Java to provide procedure-call semantics for concurrent subcomputations. Th...

متن کامل

Hosted by OOPSLA 2005 Preface

JCilk extends the Java language to provide call-return semantics for multithreading, much as Cilk does for C. Java’s built-in thread model does not support the passing of exceptions or return values from one thread back to the “parent” thread that created it. JCilk imports Cilk’s fork-join primitives spawn and sync into Java to provide procedure-call semantics for concurrent subcomputations. Th...

متن کامل

Compiling Exceptions Correctly (Extended Version)

Exceptions are an important feature of modern programming languages, but their compilation has traditionally been viewed as an advanced topic. In this article we show that the basic method of compiling exceptions using stack unwinding can be explained and verified both simply and precisely, using elementary functional programming techniques. In particular, we develop a compiler for a small lang...

متن کامل

Compiling Exceptions Correctly

Exceptions are an important feature of modern programming languages, but their compilation has traditionally been viewed as an advanced topic. In this article we show that the basic method of compiling exceptions using stack unwinding can be explained and verified both simply and precisely, using elementary functional programming techniques. In particular, we develop a compiler for a small lang...

متن کامل

An Exceptional Programming Language

The use of exceptions in programming languages is usually reserved for exceptional conditions. This is a narrow view of exceptions, however. We demonstrate how exceptions can be used to express common programming language constructs, and thus form the basis of a new type of exception-based programming language. We also generalize exceptions so that they may be thrown into a program’s future exe...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Sci. Comput. Program.

دوره 63  شماره 

صفحات  -

تاریخ انتشار 2006